#ifndef PRASE_H
#define PRASE_H

#include <QObject>

struct PowerInfo{
    QString updateTime;
    QString endPointHex;
    int power1;
    int power2;
    int power3;
    int power4;
    int power5;
    int power6;
};
struct GPSInfo{
    QString updateTime;
    QString userPointHex;
    QString time;
    QString longitude;
    QString latitude;
    int hight;
    int speed;
    int direction;
    int sateLiteNum;
    int status;
    int precision;
    int deviation;
};
struct CommunicationInfo{
    QString updateTime;
    QString userPointHex;
    QString msgType;
    QString senderEndPointHex;
    QString sendTime;
    QString recInfomationSize;
    QString recInfomation;
    QString CRCStatus;
};

class Prase : public QObject
{
    Q_OBJECT
public:
    explicit Prase(QObject *parent = nullptr);

    void  parseHeader(const char* src , QString & orderName , int & len);

    PowerInfo  parseGLJC(QByteArray);

    GPSInfo  parseGPS(QByteArray info );

    CommunicationInfo parseCommunication(QByteArray info);

    void  check(QByteArray ,QByteArray);

    void  crc(QByteArray, QByteArray);
signals:

};

#endif // PRASE_H
